/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tesoreria.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "tes_forma_pago")
//@NamedQueries({@NamedQuery(name = "FormaPago.findAll", query = "SELECT f FROM FormaPago f"), @NamedQuery(name = "FormaPago.findByFpaCodigo", query = "SELECT f FROM FormaPago f WHERE f.fpaCodigo = :fpaCodigo"), @NamedQuery(name = "FormaPago.findByFpaDesc", query = "SELECT f FROM FormaPago f WHERE f.fpaDesc = :fpaDesc"), @NamedQuery(name = "FormaPago.findByFpaXtipo", query = "SELECT f FROM FormaPago f WHERE f.fpaXtipo = :fpaXtipo")})
public class FormaPago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "fpa_codigo", nullable = false)
    private Integer fpaCodigo;
    @Basic(optional = false)
    @Column(name = "fpa_desc", nullable = false, length = 50)
    private String fpaDesc;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "formaDePago", fetch = FetchType.LAZY)
    private List<ComprobanteEgreso> listaComprobantesEgreso;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "formaPago", fetch = FetchType.LAZY)
    private List<Chequera> listaChequera;
    
    public FormaPago() {
    }

    public FormaPago(Integer fpaCodigo) {
        this.fpaCodigo = fpaCodigo;
    }

    public FormaPago(Integer fpaCodigo, String fpaDesc) {
        this.fpaCodigo = fpaCodigo;
        this.fpaDesc = fpaDesc;
    }

    public Integer getFpaCodigo() {
        return fpaCodigo;
    }

    public void setFpaCodigo(Integer fpaCodigo) {
        this.fpaCodigo = fpaCodigo;
    }

    public String getFpaDesc() {
        return fpaDesc;
    }

    public void setFpaDesc(String fpaDesc) {
        this.fpaDesc = fpaDesc;
    }
  
    public List<ComprobanteEgreso> getListaComprobantesEgreso() {
        return listaComprobantesEgreso;
    }

    public void setListaComprobantesEgreso(List<ComprobanteEgreso> listaComprobantesEgreso) {
        this.listaComprobantesEgreso = listaComprobantesEgreso;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fpaCodigo != null ? fpaCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FormaPago)) {
            return false;
        }
        FormaPago other = (FormaPago) object;
        if ((this.fpaCodigo == null && other.fpaCodigo != null) || (this.fpaCodigo != null && !this.fpaCodigo.equals(other.fpaCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tesoreria.be.FormaPago[fpaCodigo=" + fpaCodigo + "]";
    }

    /**
     * @return the listaChequera
     */
    public List<Chequera> getListaChequera() {
        return listaChequera;
    }

    /**
     * @param listaChequera the listaChequera to set
     */
    public void setListaChequera(List<Chequera> listaChequera) {
        this.listaChequera = listaChequera;
    }

}
